import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.DefaultCellEditor;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JTable;


public class DeleteSpreadButton extends DefaultCellEditor {
	private JButton button;
	private Boolean isDelete;

	public DeleteSpreadButton(JCheckBox arg0) {
		super(arg0);
		button = new JButton();
		button.setOpaque(true);
		button.addActionListener(new ActionListener(){
			public void actionPerformed(ActionEvent e) {
				fireEditingStopped();
			}
		});
		isDelete = false;
		// TODO Auto-generated constructor stub
	}
	
	public Object getCellEditorValue() {	
		return new Boolean(isDelete);
	}
	
	public Component getTableCellEditorComponent(JTable table, Object value,
			boolean isSelected, int row, int column)
	{
		if (value != null) {
			if (value == Boolean.FALSE) {
				isDelete = true;
			}
		}
		return button;
	}
}
